package com.itheima.Demo;

public class Tesk3 {
    public static void main(String[] args) {
        int[] sum = {1,2,3,4,5};
        int i = sumDemo(sum);
        System.out.println(i);
    }
    public static int sumDemo(int[] sum){
        int sum1 = 0;
        for (int i = 0; i < sum.length; i++) {
            sum1 += sum[i];
        }
        return sum1;
    }
}
